<?php

namespace app\system\controller;

use app\system\model\ConfigModel;
use think\App;

/**
 * 参数配置 信息操作处理
 *
 * @author xuxiwang
 */
class Config extends Base
{
    private $configModel;

    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->configModel = new ConfigModel();
    }

    /**
     * 获取配置列表
     */
    public function list()
    {
        $param = $this->request->param();
        $info = $this->configModel->paginate([
            'page'=>$param['pageNum'],
            'list_row'=>$param['pageSize']
        ])->toArray();
        $total = $this->configModel->count();
        $arr = [
            'code'=> 200,
            'msg'=> '查询成功',
            'rows'=> $info['data'],
            'total'=> $info['total']
        ];
        return json($arr);
    }

    /**
     * 根据参数编号获取详细信息
     */
    public function getInfo()
    {

    }

    /**
     * 根据参数键名查询参数值
     */
    public function getConfigKey()
    {

    }

    /**
     * 新增参数配置
     */
    public function add()
    {

    }

    /**
     * 修改参数配置
     */
    public function edit()
    {

    }

    /**
     * 删除参数配置
     */
    public function remove()
    {

    }

    /**
     *  刷新参数缓存
     */
    public function refreshCache()
    {

    }
}